<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/frontcss/menu.css">

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button class="navbar-toggle" data-toggle="collapse" data-target="#responsive-navbar">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="#" class="navbar-brand"><strong>BookShare</strong><small>大型图书共享系统</small></a>
        </div>
        <div class="collapse navbar-collapse" id="responsive-navbar">
            <s:if test="#session.existUser == null">
            <ul class="nav navbar-nav">
                <li class="active"><a href="${pageContext.request.contextPath}/user_loginPage.action" target="_top">登录</a></li>
                <li><a href="${pageContext.request.contextPath}/user_registPage.action" target="_top">注册</a></li>
            </ul>
            </s:if>
            <s:else>

            <ul class="nav navbar-nav">
                 <span class="navbar-text">尊敬的</span><li class="active"><a><s:property value="#session.existUser.nickname"/></a></li><span class="navbar-text">欢迎归来</span>
            </ul>
           <a href="${ pageContext.request.contextPath }/user_quit.action" class="btn btn-primary btn-sm navbar-btn navbar-right">退出</a>
            <div class="profile navbar-right">
                <ul class="nav navbar-nav">
                    <li><a href="jsps/frontjsps/user/change.html" target="_top">修改个人信息</a></li>
                    <li><a href="#">我的收藏</a></li>
                    <li><a href="#">我的借阅</a></li>
                    <li><a href="#">我的上传</a></li>
                    <li><a href="#">我的积分</a></li>
                </ul>
            </div>
            </s:else>
        </div>
        
        <div class="collapse navbar-collapse navbar-left menu2 hidden-xs" id="responsive-navbar2">
            <ul class="nav navbar-nav">
                <li class="active categoryli">
                    <!--<a href="${ pageContext.request.contextPath }/index.action">&nbsp;&nbsp;&nbsp;首页&nbsp;&nbsp;&nbsp; </a>-->
                    <a href="index.html">&nbsp;&nbsp;&nbsp;首页&nbsp;&nbsp;&nbsp; </a>
                </li>
                
                <s:iterator var="c" value="#session.cList">
                    <li><a href="${ pageContext.request.contextPath }/product_findByCid.action?cid=<s:property value='#c.cid'/>&page=1">&nbsp;<strong><s:property value="#c.cname"/></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</a></li>
                </s:iterator>
                
                <!-- 
                <li><a href="#">&nbsp;&nbsp;&nbsp;<strong>科技</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</a></li>
                <li><a href="#">&nbsp;&nbsp;&nbsp;<strong>文学</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</a></li>
                <li><a href="#">&nbsp;&nbsp;&nbsp;<strong>娱乐</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</a></li>
                <li><a href="#">&nbsp;&nbsp;&nbsp;<strong>体育</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</a></li>
                <li><a href="#">&nbsp;&nbsp;&nbsp;<strong>编程</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</a></li>
                <li><a href="#">&nbsp;&nbsp;&nbsp;<strong>时事</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</a></li>
                <li><a href="#">&nbsp;&nbsp;&nbsp;<strong>杂谈</strong></a></li>
                 -->
            </ul>
        </div>
        <form action="" role="form" class="form-inline hidden-xs" id="menu-form">
            <div class="form-group">
                <input type="text" id="menu-search" class="form-control" placeholder="搜索">
            </div>
            <div class="form-group">
                <button class="btn btn-warning mycolor" type="submit">搜索</button>
                <button class="btn btn-warning mycolor" type="submit">高级搜索</button>
            </div>
        </form>
    </div>
</nav>